home *** CD-ROM | disk | FTP | other *** search
- package Forms
- {
- import flash.events.MouseEvent;
- import flash.text.TextField;
- import flash.text.TextFormat;
-
- [Embed(source="/_assets/assets.swf", symbol="Forms.LevelJumpForm")]
- public class LevelJumpForm extends CluelessBaseForm
- {
-
-
- public var _bMenu:ButtonRound;
-
- protected var _dragcontroller:DragController;
-
- public function LevelJumpForm()
- {
- var _loc1_:int = 0;
- var _loc2_:int = 0;
- var _loc3_:Level = null;
- var _loc4_:TextField = null;
- _dragcontroller = new DragController();
- super();
- setBackButton(_bMenu);
- _loc1_ = 200;
- _loc2_ = 100;
- for each(_loc3_ in Database.getInstance().Levels)
- {
- (_loc4_ = new TextField()).background = true;
- _loc4_.selectable = false;
- _loc4_.border = true;
- _loc4_.defaultTextFormat = new TextFormat("Arial");
- addChildAt(_loc4_,1);
- _loc4_.x = _loc2_;
- _loc4_.y = _loc1_;
- _loc4_.height = 20;
- _loc4_.text = _loc3_.Name;
- _loc4_.addEventListener(MouseEvent.CLICK,onLevelJump,false,0,true);
- _loc4_.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
- _loc4_.addEventListener(MouseEvent.MOUSE_OUT,onOut,false,0,true);
- _loc1_ += 20;
- if(_loc1_ > 650)
- {
- _loc1_ = 200;
- _loc2_ += 200;
- }
- }
- }
-
- public static function getLevelForm(param1:String) : BaseForm
- {
- var _loc2_:DressupForm = null;
- var _loc3_:DressupLevelInfo = null;
- var _loc4_:CutsceneForm = null;
- _loc2_ = new DressupForm();
- _loc3_ = new DressupLevelInfo(param1);
- _loc2_.init(_loc3_);
- if(_loc3_.LevelCutscene != "")
- {
- (_loc4_ = new CutsceneForm()).init(_loc2_,_loc3_.LevelCutscene);
- return _loc4_;
- }
- return _loc2_;
- }
-
- protected function onOut(param1:MouseEvent) : void
- {
- (param1.currentTarget as TextField).backgroundColor = 4294967295;
- }
-
- override public function onFocus() : void
- {
- super.onFocus();
- if(Profile.CurrentProfile.Ending == 1)
- {
- onBack(new MouseEvent(""));
- }
- }
-
- protected function onOver(param1:MouseEvent) : void
- {
- (param1.currentTarget as TextField).backgroundColor = 4294951104;
- }
-
- protected function onLevelJump(param1:MouseEvent) : void
- {
- var _loc2_:String = null;
- _loc2_ = (param1.currentTarget as TextField).text;
- setForm(getLevelForm(_loc2_));
- }
- }
- }
-